#pragma once
#include "../stdafx.h"
#include "../math/Coordinate.h"
#include "../game/Tmp_Manager.h"
	class Coordinate;
	extern LPDIRECT3DDEVICE9 g_pd3dDevice;
	typedef struct _PIC
	{
		int32 id;
		int32 tid;
		LPDIRECT3DTEXTURE9 tex;
		D3DXIMAGE_INFO info;
		D3DXVECTOR2 pos;
		RECT srcRect;
		bool draw;
	}PICTURE;

	class ScreenWorld : public Manager<PICTURE> , public Component
	{
	public:
		ScreenWorld(int32,int32);
		~ScreenWorld(void);

		
		void addedToObject();
		void Init(Message const &msg);
		void InitFightMenu(Message const &msg);
		bool AddFightMenu(int32 id, char* fname);
		bool AddSysMenu(int32 id,char* fname);
		void Render(Message const &msg);
		bool UpdateBattle();
		bool UpdatePos(int32,D3DXVECTOR2);
		void AddBattle(Message const & msg);
		void DeleteBattle(Message const & msg);
		void DeleteBattle();
		bool DrawPic(int32);
		bool UnDrawPic(int32);
		void UpdateMousePos(Message const &msg);
		bool UpdateBattle(D3DXVECTOR2);
		void ClickedMenu(Message const &msg);
	private:
		ID3DXSprite*		m_pSprite;
		void Log();
		bool HasObj(int32);
		int32 AddMenu(int32 id, char* fname);
		HRESULT RenderScreenWorld();
		int32 m_cursor;
		int32 m_bradius;
		D3DXVECTOR3 m_battlePos;
		bool m_bMenu;
		int32 m_screenWidth;
		int32 m_screenHeight;
	};